﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Diagnostics;
using System.IO;

namespace DreamShieldBindingCompiler
{
    public class SetupCompilerEndPoint
    {
        public virtual string DreamShieldPath { get; protected set; }

        public SetupCompilerEndPoint(string dreamshieldPath)
        {
            DreamShieldPath = dreamshieldPath;

            DSIntegration.Initialize(dreamshieldPath);
            Compiler = new SetupCompiler();
        }

        public virtual SetupCompiler Compiler { get; protected set; }

        public virtual string CompilerPath
        {
            get { return Path.Combine(DreamShieldPath, "DSCC.exe"); }
        }

        public virtual ProcessStartInfo CreateCompiler_StartInfo(string arguments)
        {
            ProcessStartInfo st = new ProcessStartInfo();
            st.Arguments = arguments;
            st.FileName = CompilerPath;
            return st;
        }

        public virtual Process CreateCompilerProcess(string arguments)
        {
            return Process.Start(CreateCompiler_StartInfo(arguments));
        }
    }
}
